# -*- coding: utf-8 -*-

def Singleton(person):
    instance = None
    def GetPerson():
        if None != instance:
            return instance
    instance = person()
    return GetPerson


@Singleton
class GetPerson(object):
    def __init__(self):
        pass

person1 = GetPerson()
person2 = GetPerson()
print(id(person1) == id(person2))
assert person1 is person2, "不是单例"
